home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 12 / BBS in a box XII-1.iso / Files / Bus / C / Commander Demo1.2b2.sit / Commander Demo.rsrc / TEXT_5008_ADD SUBRECORD.txt < prev    next >
Encoding:
Text File  |  1993-09-07  |  2.2 KB  |  33 lines

  1. ADD¬†SUBRECORD (subfile; layout; {*})
  2.                                                                Pg 17-5
  3.  
  4. subfile      Subfile        Subfile to use for data entry
  5. layout       String         Name of the layout to display
  6. *                                Hide scroll bars and size box
  7.  
  8.  
  9. ADD SUBRECORD lets the user add a new subrecord to subfile, using layout. ADD SUBRECORD creates a new subrecord in memory, makes it the current subrecord in the current process, and displays the layout. A current record for the parent file must first exist. If a current parent record does not exist for the process, ADD SUBRECORD has no effect. The layout must belong to subfile.
  10.  
  11. The subrecord is kept in memory (accepted) if the user clicks an Accept button or presses the Enter key, or if the ¬†ACCEPT command is executed. Accepting the subrecord sets the OK system variable to 1. Once the subrecord has been added or modified, the parent record must be explicitly saved in order for the subrecord to be saved (to disk).
  12.  
  13. The subrecord is not saved if the user clicks a Cancel button or presses the "Cancel" key combination (Command-period), or if the ¬†CANCEL command is executed. Canceling sets the OK system variable to 0.
  14.  
  15. Subrecords are always added to the current parent record. If a subfile is within a subfile, make sure that the proper parent record (subrecord) is first selected.
  16.  
  17. The layout is displayed in a window with scroll bars and a size box. Specifying the optional asterisk (*) causes the window to be drawn without scroll bars or a size box.
  18.  
  19. The layout procedure execution cycle is started if a layout procedure exists for layout. Scripts that exist for layout may also be executed, depending on the user's actions. 
  20.  
  21.  
  22. The following example is part of a global procedure. It adds a subrecord for a new child to an employees record. The data for the children is stored in a subfile named [Employees]Children. Notice that the [Employees] record must be saved in order for the new subrecord to be saved:
  23.  
  24.     ADD SUBRECORD([Employees]Children;"Add Child")
  25.     If (OK=1)                                      ` If the user accepted subrecord
  26.        SAVE RECORD([Employees])     ` save the [Employees] record
  27.    End if
  28.  
  29.  
  30.  
  31. See also: MODIFY¬†SUBRECORD, SAVE¬†RECORD
  32.  
  33.